<template>
<el-container>
  <el-aside width="35%">
    <el-row class="tac">
      <el-col :span="24">
        <el-menu
        router
          :collapse='false'
          default-active="/"
          class="el-menu-vertical-demo"
          @open="handleOpen"
          @close="handleClose">

          <el-submenu index="1" :popper-append-to-body="false">
            <template slot="title">
              <i class="el-icon-location"></i>
              <span>地区一</span>
            </template>
            <el-menu-item-group>
              <el-menu-item index="/area1">区域1</el-menu-item>
              <el-menu-item index="/area2">区域2</el-menu-item>
              <el-menu-item index="/area3">区域3</el-menu-item>
            </el-menu-item-group>
          </el-submenu>
          <el-menu-item index="2">
            <i class="el-icon-location"></i>
            <span slot="title">地区二</span>
          </el-menu-item>
          <el-menu-item index="3">
            <i class="el-icon-location"></i>
            <span slot="title">地区三</span>
          </el-menu-item>
          <el-menu-item index="4">
            <i class="el-icon-location"></i>
            <span slot="title">地区四</span>
          </el-menu-item>
        </el-menu>
      </el-col>
    </el-row>
  </el-aside>
  <el-main><router-view/></el-main>
</el-container>
</template>

<script>
import Area1 from './area/area1.vue'
import Area2 from './area/area2.vue'
import Area3 from './area/area3.vue'
export default {
  name: '/',
  data () {
    return {}
  },
  components: {Area1, Area2, Area3},

  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    }
  }
}
</script>

<style>
.el-menu--popup{
   min-width:72px !important;
}
</style>